home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: How to delete array of pointers?
- Date: 11 Feb 1996 15:11:40 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4fl0vc$55s@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe10.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Feb 10, 1996 02:28:46 in article <How to delete array of pointers?>,
- 'ywleung@cs.cuhk.hk (Marty McFly)' wrote:
-
-
- >If I write the following code in a function:
- >
- > int** ptr;
- > ptr = new int*[1000];
- >
- >Is this code means allocating 1000 integer pointers which is pointed by
- ptr?
- >And then somehow I assign integer variable to ptr[0], ptr[1], ... and so
- on.
- >So at the end of the function, how can I reclaim just those pointers? The
- key
- >point is that those integer variable assigned to the pointers should not
- be
- >deleted.
- >
- delete [] ptr;
-
- --
- Pete Grant
- Kalevi, Inc.
- Object Oriented Software Development
-